<!-- 添加检测项目 -->
<!-- 修改检测项目 -->
<template>
  <div id="dialog-container">
    <el-button @click="dialogVisible = true">添加检测项目</el-button>
    <el-dialog v-dialogDrag :title="'新增技术要求'" append-to-body :visible.sync="dialogVisible" :close-on-click-modal="false" width="680px">
      <el-form :model="formData" :inline="true" size="small">
        <el-row>
          <el-col :span="12">
            <el-form-item label="检测类型">
              <el-select v-model="formData.testType" filterable placeholder="请选择" style="width: 200px;">
                <el-option v-for="item in typeList" :key="item.code" :label="item.name" :value="item.code"></el-option>
              </el-select>
              <!-- <el-input v-model="formData.name"></el-input> -->
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="检测项目">

              <el-input v-model="formData.name"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <el-table ref="multipleTable" :data="tableData" style="width: 100%">
        <el-table-column type="selection" width="55">
        </el-table-column>
        <el-table-column prop="date" label="日期" width="180">
        </el-table-column>
        <el-table-column prop="name" label="姓名" width="180">
        </el-table-column>
        <el-table-column prop="address" label="地址">
        </el-table-column>
      </el-table>
      <!-- <el-button>添加</el-button>
      <el-form style="margin-top:15px;" :model="formData" :inline="true" size="small">
        <el-row>
          <el-col :span="12">
            <el-form-item label="检测类型">
              <el-input v-model="formData.part"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="检测项目">
              <el-input v-model="formData.number"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="检测标准">
              <el-input v-model="formData.name"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="检测位置">
              <el-input v-model="formData.number"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="标尺/技术要求">
              <el-input v-model="formData.name"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="数值范围">
              <el-input v-model="formData.number"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="对应检测设备">
              <el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="formData.number">
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form> -->
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
  import {
    getTypeList
  } from "service/task";
  import {
    getLableFromList
  } from "utils/common";
  export default {
    data() {
      return {
        dialogVisible: false,
        formData: {
          name: "",
          number: ""
        },
        typeList: [],
        tableData: []
      };
    },
    props:[],
    watch:{
      dialogVisible() {
        this.showList();
      }
    },
    method: {
      showList(){

      }
    },
    mounted() {
      getTypeList().then(res => {
        this.typeList = res.data.result;
      })
    }
  };
</script>
